<template>
    <div class="product">
        <div class="product-title">业绩爆雷风险</div>

        <div class="product-fenxian">
            <div v-for="(item,index) in resData" :key="index">
                <p class="product-fenxian-title">{{ item.year }}</p>
                <img :src="IMG_URL + '/tag-3.png'" style="width: 30px;" v-if="item.risk == 0">
                <img :src="IMG_URL + '/tag-6.png'" style="width: 30px;" v-if="item.risk == 1">
                <img :src="IMG_URL + '/tag-4.png'" style="width: 30px;" v-if="item.risk == 2">
                <p class="product-fenxian-text">{{ item.risk | riskMsg }}</p>
            </div>
        </div>

        <div class="collect-group">
            <div class="collect-group-label">
                <p>判断标准：</p>
                <p>存货&商誉</p>
            </div>
        </div>
    </div>
</template>

<script>
    import {performanceRisk} from "../../api/index";

    export default {
        name: "echart7",
        data(){
            return {
                resData: []
            }
        },
        filters: {
            riskMsg(val){
                let msg = '';
                switch (parseInt(val)){
                    case 0:
                        msg = '低风险';
                        break;
                    case 1:
                        msg = '普通';
                        break;
                    case 2:
                        msg = '有风险';
                        break;
                }
                return msg;
            }
        },
        mounted() {
            this.init();
        },
        methods: {
            async init(){
                let tscode = this.$route.query.tscode;
                await performanceRisk(tscode).then(res=>{
                    console.log("res",res)
                    this.resData = res;
                });
            }
        }
    }
</script>

<style scoped>

</style>
